#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：图灵学习 
@File    ：8.实现join方法是否对子线程造成影响.py
@IDE     ：PyCharm 
@Author  ：ChenLiGao
@Date    ：2024-10-31 14:44
'''
import threading

num = 0

def add():
    global num
    for i in range(100000):
        num += i
def sub():
    global num
    for i in range(10000):
        num -= i

t1 = threading.Thread(target=add)
t2 = threading.Thread(target=sub)

t1.start()
t2.start()
t1.join()
print(num)


t2.join()
print(num)
